/**
 * 
 */
package cc.rico.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

/**
 * ElasticsearchTemplate util
 * @author JiWo 2016年7月27日
 *
 */
public class ElasticsearchTemplateUtil {
	private static ElasticsearchTemplate elasticsearchTemplate;
	
	static {
		ApplicationContext context = new ClassPathXmlApplicationContext("spring-es.xml");
		elasticsearchTemplate = (ElasticsearchTemplate) context.getBean("elasticsearchTemplate");
	}
	
	public static ElasticsearchTemplate getInstance() {
		return elasticsearchTemplate;
	}
}
